package com.uyaer.engine.display.el
{
	import com.uyaer.engine.text.TextCache;
	
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.geom.Rectangle;
	
	public class StaticSprite extends Sprite
	{
		public var bmAnim:Animation;
		public function StaticSprite(id:String, bmd:BitmapData)
		{
			var framesClip:Vector.<Rectangle> = new Vector.<Rectangle>();
			var key:String = id + ".png";
			framesClip.push(TextCache.texturePacker.get(key) as Rectangle);
			bmAnim = new Animation(id,bmd,framesClip);
			addChild(bmAnim);
		}
		
		public function render():void
		{
			if(!bmAnim.isShare){
				bmAnim.render();
			}
		}
	}
}